export interface LanguageConfig {
    id: string;
    extensions: string[];
    aliases: string[];
    snippetPrefix: string;
}

export const SUPPORTED_LANGUAGES: LanguageConfig[] = [
    {
        id: 'typescript',
        extensions: ['.ts', '.tsx'],
        aliases: ['TypeScript', 'ts'],
        snippetPrefix: 'ts'
    },
    {
        id: 'javascript',
        extensions: ['.js', '.jsx'],
        aliases: ['JavaScript', 'js'],
        snippetPrefix: 'js'
    },
    {
        id: 'python',
        extensions: ['.py'],
        aliases: ['Python', 'py'],
        snippetPrefix: 'py'
    },
    {
        id: 'java',
        extensions: ['.java'],
        aliases: ['Java'],
        snippetPrefix: 'java'
    },
    {
        id: 'csharp',
        extensions: ['.cs'],
        aliases: ['C#', 'cs'],
        snippetPrefix: 'cs'
    },
    {
        id: 'go',
        extensions: ['.go'],
        aliases: ['Go'],
        snippetPrefix: 'go'
    },
    {
        id: 'rust',
        extensions: ['.rs'],
        aliases: ['Rust'],
        snippetPrefix: 'rs'
    },
    {
        id: 'php',
        extensions: ['.php'],
        aliases: ['PHP'],
        snippetPrefix: 'php'
    }
];

export function getLanguageConfig(languageId: string): LanguageConfig | undefined {
    return SUPPORTED_LANGUAGES.find(lang => 
        lang.id === languageId || 
        lang.aliases.includes(languageId)
    );
}

export function isSupportedLanguage(languageId: string): boolean {
    return !!getLanguageConfig(languageId);
} 